﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="MerchandiseList.aspx.vb" Inherits="gojira.MerchandiseList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        Here you can view the merchandise collected by other memebers or upload your 
        own.</p>
    <p>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" 
            Width="100%" class="gridStyle">
            <Columns>
                <asp:BoundField DataField="ItemType" HeaderText="Type" 
                    SortExpression="ItemType" />
                <asp:BoundField DataField="Description" HeaderText="Description" 
                    SortExpression="Description" />
                <asp:BoundField DataField="FanName" HeaderText="Uploader" 
                    SortExpression="FanName" />
                    <asp:TemplateField HeaderText="Picture" ItemStyle-HorizontalAlign="Center">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Eval("Picture") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "MerchandiseDetail.aspx?ID=" + Eval("ID").toString() %>' ItemStyle-HorizontalAlign="Center">
                        <asp:Image ID="Image1" runat="server" Height="200px" Width="200px" ImageUrl='<%# Eval("Picture") %>' />
                    </asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
                <asp:HyperLinkField DataNavigateUrlFields="ID" 
                    DataNavigateUrlFormatString="MerchandiseDetail.aspx?ID={0}" HeaderText="Detail" 
                    Text="More detail" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:godzillaFilms %>" 
            ProviderName="<%$ ConnectionStrings:godzillaFilms.ProviderName %>" 
            
            SelectCommand="SELECT [ItemType], [Description], [FanName], [Picture], [ID] FROM [Merchandise]">
        </asp:SqlDataSource>
    </p>
    <p>
    <a href="AddMerchandise.aspx">Add your own merchandise item</a>
    </p>
</asp:Content>
